package com.skmusic.ui;

import android.support.v4.app.FragmentActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.alibaba.android.arouter.launcher.ARouter;
import com.skmusic.R;
import com.skmusic.constant.Constant;
import com.skmusic.sk_share.view.ShareDialog;


public class HomeActivity extends FragmentActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_home);
        Button btn= findViewById(R.id.btn);
        Button webview= findViewById(R.id.webview);
        Button update= findViewById(R.id.update);
        Button scan= findViewById(R.id.scan);
        btn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                ShareDialog dialog = new ShareDialog(HomeActivity.this,false);
                dialog.setShareText("hahahhah");
                dialog.show();
            }
        });

        webview.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                ARouter.getInstance()
                        .build(Constant.Router.ROUTER_WEB_ACTIVIYT)
                        .withString("url", "https://www.imooc.com")
                        .navigation();

            }
        });

        update.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
//                UpdateHelper.checkUpdate(HomeActivity.this);
            }
        });

        scan.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                ARouter.getInstance().build(Constant.Router.ROUTER_CAPTURE_ACTIVIYT).navigation();
            }
        });

    }
}
